<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%-- 
    Document   : EmployeeList
    Created on : May 18, 2013, 9:24:13 AM
    Author     : rmartinez
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Employee List</title>
    </head>
    <body>
        <h1>Lista de empleados</h1>
        <c:if test="${not empty requestScope.error}">
            <p style="color: red;">${requestScope.error}</p>
        </c:if>
        <c:if test="${not empty requestScope.list}">
            <table border="1">
                <thead style="color: yellow; background-color: blue;">
                    <tr>
                        <th>Código</th>
                        <th>Nombre</th>
                        <th>Apellido</th>
                        <th>Sueldo</th>
                        <th>Departamento</th>
                    </tr>
                </thead>
                <tbody>
                    <c:forEach var="r" items="${requestScope.list}">
                    <tr>
                        <td>${r.employee_id}</td>
                        <td>${r.first_name}</td>
                        <td>${r.last_name}</td>
                        <td>${r.salary}</td>
                        <td>${r.department_id}</td>
                    </tr>
                    </c:forEach>
                </tbody>
            </table>
        </c:if><br>
        <a href="index.jsp">Volver al índice</a>
    </body>
</html>
